<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: MophyJoe
  Date: 9/5/2017
  Time: 1:54 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        .tt{
            border-collapse: collapse;
            margin: 20px auto;
        }
        .tt tr th, .tt tr td{
            border: 1px solid darkgrey;
            padding: 5px;
            text-align: center;
        }
    </style>
</head>
<body>
<table class="tt">
<tr>
    <th>编号</th>
    <th>书名</th>
    <th>价格</th>
    <th>出版时间</th>
    <th>操作</th>
</tr>
    <c:forEach items="${books}" var="bo">
    <tr>
        <td>${bo.id}</td>
        <td>${bo.name}</td>
        <td><fmt:formatNumber value="${bo.price}" type="currency" /></td><!--这里用的是数字格式化，currency表示货币格式，可以不要，只按数字格式pattern="#000.00#"-->
        <td><fmt:formatDate value="${bo.date}" pattern="yyyy-MM-dd"/></td><!--这里用的是日期格式化-->
        <td><a href="/bookdelete/${bo.id}">delete</a>/<a href="">insert</a></td>
    </tr>
    </c:forEach>
</table>
</body>
</html>
